package com;

import com.zgh.mapper.StudentMapper;
import com.zgh.mybatis.MybatisUtil;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

/**
 * Created by Administrator on 2017/1/11.
 */
public class test {

    @Test
    public void student() {
        SqlSession s = MybatisUtil.getSqlSession();
        StudentMapper sm = s.getMapper(StudentMapper.class);
       // MemberMapper mm = s.getMapper(MemberMapper.class);
       // Member ms = mm.findById(1);
        //System.out.println(ms);
       /* List<Map<String,Object>> list = mm.queryAll();

        for(Map<String,Object> li : list){
            System.out.println(li.get("name"));
            System.out.println(li.get("aname"));
            System.out.println(li.get("aphone"));
        }*/
    /*
        Student st = new Student();
        st.setName("张思思");
        st.setAddress("郑州");
        sm.save(st);
        s.commit();
        s.close();
        System.out.println(11);
        List<Student> list = sm.asd();
        for (Student sts : list) {
            System.out.println("姓名:" + sts.getDname() + "   " + "家庭住址:" + sts.getDaddress());
        }
        System.out.println("共" + list.size() + "条记录");
        }
    */

    }
}
